package com.zprmb.udzt;

import java.text.DecimalFormat;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.zprmb.udzt.ll.BaseHelper;


public class ExperienceGoldSuccess extends BaseActivity implements OnClickListener{
	private TextView tv_record,tv_amount,tv_customer,tv_invate;
	private Button btn_ok;
	private String ref;
	DecimalFormat df = new DecimalFormat("###0.00");
	private RelativeLayout rl_back;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ex_out_success);
		 ref=getShare().getString("usercode", "");
		initview();
	}
	private void initview() {
		// TODO Auto-generated method stub
		tv_record=(TextView)findViewById(R.id.tv_recond);
		tv_amount=(TextView)findViewById(R.id.amount);
		btn_ok=(Button)findViewById(R.id.btn_ok);
		tv_invate=(TextView)findViewById(R.id.invate);
		rl_back=(RelativeLayout)findViewById(R.id.rl_back);
		tv_customer=(TextView)findViewById(R.id.enterprise_tel);
		tv_invate.setOnClickListener(this);
		tv_customer.setOnClickListener(this);
		rl_back.setOnClickListener(this);
		tv_record.setOnClickListener(this);
		btn_ok.setOnClickListener(this); 
		tv_invate.setText(getIntent().getStringExtra("comment"));
		String amount=getIntent().getStringExtra("amount");
		tv_amount.setText(df.format(Double.parseDouble(amount)));
	}
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		Intent intent;
		switch(v.getId()){
		case R.id.tv_recond:
			intent=new Intent(ExperienceGoldSuccess.this,ExperienceGoldOutRecord.class);
			startActivity(intent);
			break;
		case R.id.btn_ok:
		    intent=new Intent(ExperienceGoldSuccess.this,MainActivity.class);
			
		    intent.putExtra("regist", 1);
			startActivity(intent);
			break;
		case R.id.rl_back:
			finish();
			break;
		case R.id.enterprise_tel:
			BaseHelper.showDialog2(this, "拨号", "400-0101-016", 1);
			break;
		case R.id.invate:
//			shareLogin();
			intent=new Intent(ExperienceGoldSuccess.this,InvestWeb.class);
//			intent.putExtra("title", "优点智投壕送2万体验金");
//			if(ref.equals("")){
//				intent.putExtra("url", "/h5/expGain?app=true");
//			}else{
//				intent.putExtra("url", "/h5/expGain?app=true&userCode="+ref);
//			}
//			
			startActivity(intent);
			break;
			
		}
	}
//	 private void shareLogin(){
//			
//			Intent intent = new Intent(ExperienceGoldSuccess.this,WXEntryActivity.class);
//			if(ref.equals("")){
//				intent.putExtra("sharelink",Constant.URL+"/h5/expGain?app=true");	
//			}else{
//				intent.putExtra("sharelink", Constant.URL+"/h5/expGain?app=true&userCode="+ref);
//			}
//			intent.putExtra("description", "优点智投“七月司庆趴,现金欢乐送”,百万礼金，好友同享,友谊的小船永不翻~");
//			intent.putExtra("title", "优点智投壕送2万体验金，新用户免费体验投资，我出本金，你拿收益！");
//			startActivity(intent);
//		
//}
}
